﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace lab1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("adsdasdas");
            int choose;
            bool valid;
            BookStore mng=new BookStore();
            Book tmp;
            do
            {
                Console.WriteLine("1.Add new Book");
                Console.WriteLine("2.Update an existing book");
                Console.WriteLine("3.Delete an existing book");
                Console.WriteLine("4.Search books by name");
                Console.WriteLine("5.Display all books in ascending order of name or price");
                Console.WriteLine("Choose:");
                while (true)
	            {
	                try
                        {
                            choose = int.Parse(Console.ReadLine());
                            break;
                        }
                        catch (Exception)
                        {
                            Console.WriteLine("Please Input Number [1-9]");   
                        } 
	            }
                switch (choose)
                {
                    case 1:mng.Input(); break;
                    case 2: mng.Update(); break;
                    case 3: mng.remove(); break;
                    case 4: mng.searchbyName(); break;
                    case 5: mng.Display(); break;
                }

                
            } while (choose>=1&&choose<=5);
           
        }
    }
}
